3.6 \(\int \frac {\sec ^2(x)}{i+\cot (x)} \, dx\)

Optimal. Leaf size=20 \[ i x-i \tan (x)-\log (\sin (x))+\log (\tan (x)) \]

[Out]

I*x-ln(sin(x))+ln(tan(x))-I*tan(x)

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3516, 44} \[ i x-i \tan (x)-\log (\sin (x))+\log (\tan (x)) \]

Antiderivative was successfully verified.

[In]

Int[Sec[x]^2/(I + Cot[x]),x]

[Out]

I*x - Log[Sin[x]] + Log[Tan[x]] - I*Tan[x]

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 3516

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[(x^m*(a + x)^n)/(b^2 + x^2)^(m/2 + 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rubi steps

\begin {align*} \int \frac {\sec ^2(x)}{i+\cot (x)} \, dx &=-\operatorname {Subst}\left (\int \frac {1}{x^2 (i+x)} \, dx,x,\cot (x)\right )\\ &=-\operatorname {Subst}\left (\int \left (\frac {1}{-i-x}-\frac {i}{x^2}+\frac {1}{x}\right ) \, dx,x,\cot (x)\right )\\ &=i x-\log (\sin (x))+\log (\tan (x))-i \tan (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 17, normalized size = 0.85 \[ i (x-\tan (x)+i \log (\cos (x))) \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]^2/(I + Cot[x]),x]

[Out]

I*(x + I*Log[Cos[x]] - Tan[x])

________________________________________________________________________________________

fricas [B]  time = 0.65, size = 36, normalized size = 1.80 \[ \frac {2 i \, x e^{\left (2 i \, x\right )} - {\left (e^{\left (2 i \, x\right )} + 1\right )} \log \left (e^{\left (2 i \, x\right )} + 1\right ) + 2 i \, x + 2}{e^{\left (2 i \, x\right )} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(I+cot(x)),x, algorithm="fricas")

[Out]

(2*I*x*e^(2*I*x) - (e^(2*I*x) + 1)*log(e^(2*I*x) + 1) + 2*I*x + 2)/(e^(2*I*x) + 1)

________________________________________________________________________________________

giac [B]  time = 0.42, size = 53, normalized size = 2.65 \[ \frac {\tan \left (\frac {1}{2} \, x\right )^{2} + 2 i \, \tan \left (\frac {1}{2} \, x\right ) - 1}{\tan \left (\frac {1}{2} \, x\right )^{2} - 1} - \log \left (\tan \left (\frac {1}{2} \, x\right ) + 1\right ) + 2 \, \log \left (\tan \left (\frac {1}{2} \, x\right ) - i\right ) - \log \left (\tan \left (\frac {1}{2} \, x\right ) - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(I+cot(x)),x, algorithm="giac")

[Out]

(tan(1/2*x)^2 + 2*I*tan(1/2*x) - 1)/(tan(1/2*x)^2 - 1) - log(tan(1/2*x) + 1) + 2*log(tan(1/2*x) - I) - log(tan
(1/2*x) - 1)

________________________________________________________________________________________

maple [A]  time = 0.33, size = 13, normalized size = 0.65 \[ -i \tan \relax (x )+\ln \left (\tan \relax (x )-i\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)^2/(I+cot(x)),x)

[Out]

-I*tan(x)+ln(tan(x)-I)

________________________________________________________________________________________

maxima [A]  time = 0.35, size = 12, normalized size = 0.60 \[ \log \left (i \, \tan \relax (x) + 1\right ) - i \, \tan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(I+cot(x)),x, algorithm="maxima")

[Out]

log(I*tan(x) + 1) - I*tan(x)

________________________________________________________________________________________

mupad [B]  time = 0.23, size = 12, normalized size = 0.60 \[ \ln \left (\mathrm {tan}\relax (x)-\mathrm {i}\right )-\mathrm {tan}\relax (x)\,1{}\mathrm {i} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(x)^2*(cot(x) + 1i)),x)

[Out]

log(tan(x) - 1i) - tan(x)*1i

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sec ^{2}{\relax (x )}}{\cot {\relax (x )} + i}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)**2/(I+cot(x)),x)

[Out]

Integral(sec(x)**2/(cot(x) + I), x)

________________________________________________________________________________________